package com.horse.pack.common.exception;

import com.horse.pack.common.enums.ServerCode;

/**
 * @author yangliu
 * @date 2024/3/22 12:09 PM
 */
public class StackErrorException extends CommonException {


    public StackErrorException(ServerCode serverCodeEnum, Object... args) {
        this(serverCodeEnum.getCode(), serverCodeEnum.getMsg(), args);
    }

    public StackErrorException(Integer code, String message, Object... args) {
        super(code, message);
        this.code = code;
        this.args = args;
    }

    public static StackErrorException code(Integer code,String message, Object... args) {
        return new StackErrorException(code,message, args);
    }

    public static StackErrorException code(ServerCode serverCodeEnum, Object... args) {
        return new StackErrorException(serverCodeEnum, args);
    }

}
